<template>
	<scroll-view>
		<view class="box">
			<image :src="localurl+img" mode="widthFix"></image>
			<view class="subjectlist" v-for="(data,index) in list" :key="index">
				<view :class="'list fontsize'+fontsizenub" :id="data.id" @click="bindClick(data.id,data.title)">{{data.title}}</view>
			</view>
		</view>
	</scroll-view>
</template>

<script>
	import {common} from '@/common/publish.js';
	import {mapState,mapMutations} from 'vuex';
	export default {
		data() {
			return {
				img:'',
				localurl:common.url,
				list:[]
			};
		},
		computed:{
			...mapState(['fontsizenub'])
		},
		onLoad(options){
			console.log(options)
			this.img = options.img;
			uni.setNavigationBarTitle({
				title: options.title
			});
			uni.request({
				url:common.url+'/api/Frontiers/firstList.json',
				data:{
					relationid:options.id
				},
				success:(res)=>{
					if(res.statusCode == 200){
						this.list = res.data.rows
					}
				}
			})
		},
		methods:{
			//进入三级页面
			bindClick(id,title){
				uni.navigateTo({
					url: '/pages/qythree/qythree?id='+id+'&title='+title
				});
			}
		}
	}
</script>

<style lang="scss">
	@import '../.././static/iconfont.css';
	@import '@/common/publish.scss';
	@include fontsizefn(".list",32upx);
	.box{
		width: 100%
	}
	.box image{
		width: 100%;
	}
	.subjectlist{
		padding-left:20upx;
	}
	.list{
		padding-right:10px;
		border-bottom:1px solid #eee;
		color:#333;
		line-height:100upx;
		height:100upx;
	}
</style>
